package com.zdb.demo.design.pattern.behavioral.visitor.demo1;

public class TravelCities {

    private City[] cities;

    public TravelCities() {
        this.cities = new City[]{new Beijing(), new Shanghai(), new Shenzhen()};
    }

    public void accept(Visitor visitor) {
        for (int i = 0; i < cities.length; i++) {
            cities[i].accept(visitor);
        }
    }
}
